import { createStore } from 'vuex'
import createPersistedstate from 'vuex-persistedstate'
import userStore from './modules/user.js'
import carStore from './modules/car.js'
import getters from './getters.js'
import categoryStore from './modules/category.js'

const modules = { userStore, carStore, categoryStore }

export default createStore({
  modules,
  getters,
  plugins: [
    createPersistedstate({
      key: 'rabbit-shop', // key
      paths: ['userStore', 'carStore'] // 模块名
    })
  ]
})
